home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gigarom 1
/
Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso
/
FILES
/
HYP
/
C-D
/
ChooseIcon & CustomFileName.cpt
/
ChooseIcon & CustomFileName
/
card_3568.txt
< prev
next >
Wrap
Text File
|
1989-02-26
|
8KB
|
360 lines
-- card: 3568 from stack: in
-- bmap block id: 2284
-- flags: 0000
-- background id: 2791
-- name:
----- HyperTalk script -----
on openCard
put "This is the 'Results' field." into card field "Results"
end openCard
-- part 9 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=29 top=43 right=62 bottom=236
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: One
----- HyperTalk script -----
on mouseUp
put ChooseIcon() into card field "Results"
end mouseUp
-- part 10 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=29 top=68 right=84 bottom=344
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Two
----- HyperTalk script -----
on mouseUp
put ChooseIcon("Please choose an icon:") into card field "Results"
end mouseUp
-- part 11 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=29 top=92 right=110 bottom=486
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Three
----- HyperTalk script -----
on mouseUp
put ChooseIcon("These are the icons in this stack, please select one:",1) into card field "Results"
end mouseUp
-- part 12 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=29 top=115 right=133 bottom=279
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Four
----- HyperTalk script -----
on mouseUp
put CustomFileName() into card field "Results"
end mouseUp
-- part 13 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=29 top=140 right=156 bottom=290
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Five
----- HyperTalk script -----
on mouseUp
put CustomFileName("STAK") into card field "Results"
end mouseUp
-- part 14 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=29 top=163 right=181 bottom=328
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Six
----- HyperTalk script -----
on mouseUp
put line 1 of CustomFileName("STAK") into card field "Results"
end mouseUp
-- part 15 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=29 top=188 right=204 bottom=490
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Seven
----- HyperTalk script -----
on mouseUp
put line 1 of CustomFileName("STAK","Please choose a HyperCard Stack:") into card field "Results"
end mouseUp
-- part 16 (field)
-- low flags: 01
-- high flags: 2004
-- rect: left=4 top=264 right=311 bottom=510
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 3
-- text size: 9
-- style flags: 256
-- line height: 12
-- part name: Results
----- HyperTalk script -----
on mouseUp
put empty into card field "Results"
end mouseUp
-- part 26 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=118 top=21 right=38 bottom=378
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Demo
----- HyperTalk script -----
on mouseUp
show card field "Nahhhh..."
end mouseUp
-- part 33 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=243 top=311 right=340 bottom=279
-- title width / last selected line: 0
-- icon id / first selected line: 29114 / 29114
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Return
----- HyperTalk script -----
on mouseUp
visual effect iris close
go to first card
end mouseUp
-- part 27 (field)
-- low flags: 81
-- high flags: 2004
-- rect: left=5 top=24 right=337 bottom=507
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 2
-- text size: 24
-- style flags: 22784
-- line height: 32
-- part name: Nahhhh...
----- HyperTalk script -----
on mouseUp
hide card field "Nahhhh..."
end mouseUp
-- part 48 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=29 top=212 right=228 bottom=490
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Eight
----- HyperTalk script -----
on mouseUp
put line 1 of CustomFileName("","Select any file:","Select/S") into card field "Results"
end mouseUp
-- part 49 (button)
-- low flags: 00
-- high flags: A002
-- rect: left=29 top=236 right=254 bottom=343
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Sample Button to Create a "Stack Button"
----- HyperTalk script -----
on mouseUp
doMenu "New Button" -- Make a new button
-- give it a name
ask "Please Name The Button:" with "My Stack Button"
-- if you don't name it the forget the whole thing
if it is empty then
doMenu "Cut Button"
choose browse tool
exit mouseUp
end if
put it into btnName
-- Check for duplicates
repeat with i = 10 to the number of btns
if btnName is the short name of btn i then
answer "Button name already exists." with "Oh"
doMenu "Cut Button"
choose browse tool
exit mouseUp
end if
end repeat
-- if you do name it
set showName of btn "New Button" to false
set name of btn "New Button" to btnName
-- make it bigger, etc.
set rect of btn btnName to 382,114,465,176
set style of btn btnName to rectangle
set autoHilite of btn btnName to true
set icon of btn btnName to 1020 -- a question mark in the interim
set showName of btn btnName to true
-- Display Icons with the prompt string
put ChooseIcon("Please Choose An Icon For Your Button:") into myIcon
-- if you cancel, then forget the whole thing
if myIcon is empty then
forgetIt btnName
exit mouseUp
end if
-- if you don't cancel, then set the icon
set the icon of btn btnName to myIcon
-- get just the pathname of a selected stack, use prompt string
-- don't let user link button to this stack (or "go backs" will
-- leave stack
put false into anotherStack
repeat until anotherStack
put line 1 of CustomFileName("STAK","Please choose a stack to link to:") into whichStack
if whichStack is empty then
forgetIt btnName
exit mouseUp
end if
if the short name of whichStack is not the short name of this stack then
put true into anotherStack
else
answer "Please choose a different stack." with "OK"
end if
end repeat
-- otherwise go to the selected stack if it's not this one
go to whichStack
answer "Link Button To This Stack?" with "Cancel" or "OK"
if it contains "Cancel" then
doMenu "Back"
forgetIt btnName
exit mouseUp
else
doMenu "Back"
put "on mouseUp"&return&"go to"&&whichStack&return&"end mouseUp"& return into myScript
set script of btn btnName to myScript
end if
answer "Congratulations, you have Succeeded" with "Splendid!"
choose browse tool
end mouseUp
on forgetIt btnName
get location of btn btnName
click at it
doMenu "Cut Button"
choose Browse tool
end forgetIt
-- part contents for card part 27
----- text -----
Nahhh...this one doesn't do anything!
-- part contents for card part 16
----- text -----
This is the 'Results' field.